package com.microptech.serviceorder.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("order")
@RefreshScope
public class OrderController {

    @Value("${server.port}")
    private String port;

    @Value("${foo}")
    private String foo;

    @GetMapping("/testConfig")
    public String testConfig() {
        return foo;
    }

    @GetMapping("/create")
    public String create(int uid, int goodsId, int amount) {
        return port+"新订单创建完成"+uid+goodsId+amount;
    }
}
